﻿using Domain.Entity;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EfCore.Configers
{
    public class TrainingConfigers : IEntityTypeConfiguration<Training>
    {
        public void Configure(EntityTypeBuilder<Training> builder)
        {
            builder.ToTable(nameof(Training));

            builder.HasKey(e => e.TrId);

            builder.Property(e => e.TrId).ValueGeneratedOnAdd();

            builder.Property(e => e.MajorKindName).HasMaxLength(50);
            builder.Property(e => e.MajorName).HasMaxLength(50);
            builder.Property(e => e.HumanName).HasMaxLength(50);
            builder.Property(e => e.TrainingItem).HasMaxLength(100);
            builder.Property(e => e.TrainingDegree).HasMaxLength(50);
            builder.Property(e => e.Register).HasMaxLength(50);
            builder.Property(e => e.Checker).HasMaxLength(50);
            builder.Property(e => e.Checkstatus).HasMaxLength(20);
            builder.Property(e => e.Remark).HasMaxLength(500);
        }
    }
}
